/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.rafkind.crawl.data;

import com.rafkind.crawl.battle.BattleCommand;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author dave
 */
public class Team {
  protected List<Creature> members;
  protected Team opposingTeam;

  public Team() {
    members = new ArrayList<Creature>();    
  }
  
  public List<Creature> getMembers() {
    return members;
  }
  
  public void add(Creature... creatures) {
    for (Creature c : creatures) {
      members.add(c);
      c.setMyTeam(this);
    }
  }
  
  public void setOpposingTeam(Team t) {
    for (Creature c : members) {
      c.setOpposingTeam(t);
    }
    opposingTeam = t;
  }
  
  public BattleCommand getBattleCommandFor(Creature creature) {
    throw new UnsupportedOperationException("Not yet implemented");
  }
  
  public boolean hasAnyActiveMembers() {
    for (Creature c : members)
      if (c.isActiveInBattle())
	return true;
    
    return false;
  }
}